package com.ruoyi.system.service.impl;

import cn.hutool.core.collection.CollUtil;
import cn.hutool.extra.mail.MailAccount;
import cn.hutool.extra.mail.MailUtil;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.system.mapper.SysConfigMapper;
import com.ruoyi.system.service.ISendMailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;


/**
 * 参数配置 服务层实现
 * 
 * @author ruoyi
 */
@Service
public class SendMailServiceImpl implements ISendMailService {
    @Resource
    private SysConfigMapper configMapper;

    @Autowired
    private RedisCache redisCache;


    @Override
    public void sendMain(){
        MailAccount account = new MailAccount();
        account.setHost("smtp.qq.com");
        account.setPort(587);
        account.setAuth(true);
        account.setFrom("1392112707@qq.com"); //发件人邮箱
        account.setUser("1392112707"); //账号
        account.setPass("zlnmwwpapghuhdai"); //授权码

        MailUtil.send(account, CollUtil.newArrayList("1934320964@qq.com"), "测试", "邮件来自Hutool测试", false);
    }
}
